package com.ky.pro.java.jvm;

/**
 * @ClassName Hello
 * @Description TODO
 * @Date 2021/11/6 22:32
 * @Author kevin
 **/
public class Hello {

    public static void main(String[] args) {
        int k = 0;
        for (int i = 0; i < 5; i++) {
            k = calc(k, i);
        }
        System.out.println("k = " + k);
    }

    public static int calc(int k, int i) {
        if (i % 2 == 0) {
            k += i;
        }
        return k;
    }

}
